Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-branch

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-branch

Get the current branch for a local git repository.

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
72K
decreased by-11.85%
Maintainers
1
Weekly downloads
 
Created
Source

git-branch NPM version

Get the current branch for a local git repository.

Install with npm

npm i git-branch --save

Usage

var branch = require('git-branch');

// async
branch(function (err, res) {
  //=> 'master'
});

// sync
branch.sync();
//=> 'master'
  • parse-git-config: Parse .git/config into a JavaScript object. sync or async.
  • git-username: Get the username from a git remote origin URL.
  • git-user-name: Get a user's name from git config at the project or global scope, depending on what git uses in the current context.
  • git-repo-name: Get the repository name from the git remote origin URL.

Running tests

Install dev dependencies.

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb-cli on March 09, 2015.

Keywords

FAQs

Package last updated on 09 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc